package homeworks.cjt2009.homework1.teacher.solution;

public class Room {
	private int number;
	private int capacity;
	private float rate;
	
	public Room(int capacity) {
		this(0, capacity, 0);
	}

	public Room(int number, int capacity, float rate) {
		super();
		this.number = number;
		this.capacity = capacity;
		this.rate = rate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + number;
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Room other = (Room) obj;
		if (number != other.number)
			return false;
		return true;
	}
	
	public int getNumber()
	{
		return number;
	}
	
	public int getCapacity()
	{
		return capacity;
	}
	
	public float getRate()
	{
		return rate;
	}
	
	public String toString()
	{
		return "[" + number + ", " + capacity + ", " + rate + "]";
	}
}
